feat(engine): adopt memory-core as the one local engine (M2-C)#217
Merged
Conversation
Contributor
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Ready to merge! ✨ 🔗 View workflow run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adopt
@agentage/memory-core(^0.1.1, MIT) as the one local engine for the CLI (decision V11-C). The shipped FTS5/SQLite index engine is retired; every memory verb now runs over memory-core's git-per-vault local backend + federation router.Why
One engine, everywhere. memory-core is the shared foundation (also under
server-memoryand the cloud MCP). The CLI stops carrying its own storage/index/edit code and its own config schema, and instead delegates to the published package. Net: -1120 lines, a smaller dependency surface, and byte-identical storage semantics with the rest of the product.Config-format unification
{ $schema?, version: 1, vaultsDir?, autodiscover?, autoInit?, default?, vaults: { <name>: { path?, origin?: [{ remote, interval?, ignore? }], mcp? } } }. Validation is memory-core'svalidateConfig(rule: an entry needsoriginand/orpath).$schemalink (https://agentage.io/schemas/vaults.schema.json), and saves stay atomic +0600.@agentage/server-memoryreads the same file and parses only JSON.type; account/sync vaults are deferred - do not invent fields memory-core does not validate).Vault commands (unified shape)
vault add <name> --local [path]writes{ path }(path defaults to~/vaults/<name>);--git <remote>writes{ origin: [{ remote }] }. First vault added becomesdefault.vault remove <name>deletes the entry; if it was thedefault, the default is reassigned to a remaining vault (or cleared when none remain).vault reindexis gone (no index to rebuild).Engine swap
DirectClientbuilds memory-core local backends +createRouterfrom the loaded config and delegatessearch/read/write/edit/delete/list.MemoryClientresult shapes are now memory-core's contract types at full fidelity:SearchResult(hits{ path, title, snippet, score, updated }+nextCursor?)MemoryView({ path, title, frontmatter, body, tags, updated, deleted })WriteResult({ path, rev, updated })ListResult(folder-TREE withdepth/tags){ path, deleted }(git rm + commit; recoverable from history)@<vault>/<path>addressing and--vaultboth route through the router (--vaultbecomes an@-prefix). Human UX and flags are unchanged;--jsonprints the structured result.Removals (retired FTS5 engine)
Deleted
src/lib/{vault-index,vault-scan,vault-store,memory-edit,path-safety}.ts,src/commands/reindex.ts(+ tests), thevault reindexregistration, and thenode:sqlitebootstrap /--experimental-sqlitere-exec insrc/cli.ts+ the vitestexecArgventry.git grepneeds no index.R6 package guard
Amended minimally (sanctioned by V7/V11-C): the runtime-dep set is now
@agentage/memory-core + chalk + commander + open(drops the directyaml/zod). The forbidden-token binding is unchanged - still no daemon, no:4243, no native addons.Verification
npm run verifygreen (type-check + e2e type-check + lint + format + 118 unit tests + build).vault-offline,memory-offline,m1-requirements) driving the built binary; the 6 memory verbs pass network-blackholed against a scratch vault, git-initted in place with a commit per mutation.dist/cli.jsin an isolatedAGENTAGE_CONFIG_DIR: add -> write -> search -> read -> edit -> list -> delete, confirmed the vault folder became a git repo with write/edit/delete commits.Do not merge until CI is green.